package com.simple.create.factory.sample2;

import com.simple.LogUtil;

/**
 * 简单工厂模式 - 示例2
 * 使用方法直接创建的对象
 * 弊端:  创建对象需要实例化工厂类, 即 依赖于工厂类的创建
 *
 * @author simple
 * @version 1.0
 * @date 2018/12/4 15:07
 * @since 1.0
 */
public class Start {
    /**
     * @param args Command line argument
     */
    public static void main(String[] args) {
        SendFactory factory = new SendFactory();
        LogUtil.info("prduce MailSender" + "\n");
        Sender sender1 = factory.produceMail();
        sender1.send();
        LogUtil.info("prduce SmsSender" + "\n");
        Sender sender2 = factory.produceSms();
        sender2.send();
    }
}
